<div id="main">
  <div class="frame clearfix mt0">
   	    <div class="top"></div>
       	  <div class="body clearfix">

   		    <h1 class="section-title-02 cart-title">Košarica</h1>
<?php foreach ($baskets as $basket): ?>
           	  <table id="cart-tbl" width="722" border="0" cellspacing="0" cellpadding="0">
                <tr>
                  <th width="269" class="pl20">Naziv proizvoda</th>
                  <th width="100" class="tar">Cijena</th>
                  <th width="101" class="tar">Količina</th>
                  <th width="90" class="tar">Popust</th>
                  <th width="100" class="tar">Ukupno</th>
                  <th width="62">&nbsp;</th>
                </tr>
                <tr>
                  <td class="header-line" colspan="6"></td>
                </tr>

                <!-- product listing begin -->
<?php foreach ($basket->Items as $basket_item): $photo = $basket_item->getProduct()->getDefaultPhoto();  ?>
<tr>
                <tr class="item">
                  <td class="item-first-cell">
                      <?php echo link_to(
                              $basket_item->getProduct()->getName(),
                              'product_show',
                              array(
                                  'slug'=> $basket_item->getProduct()->getSlug()
                                  )
                              ) ?>
                  </td>
                  <td>
<?php echo format_currency($basket_item->getProduct()->getPrice()); ?> kn
                  </td>
                  <td>
                  <a class="more" 
                     href="<?php echo url_for(
                             'basket_changequantity',
                             array(
                                 'item_id'=>$basket_item->getId(),
                                 'quantity'=>$basket_item->getQuantity()+1
                             )) ?>"
                     title="povećaj količinu"></a>
                  <input type="text" value="<?php echo $basket_item->getQuantity() ?>" class="qty" />
                  <a class="less"
                     title="smanji količinu"
                     href="<?php echo url_for(
                             'basket_changequantity',
                             array(
                                 'item_id'=>$basket_item->getId(),
                                 'quantity'=>$basket_item->getQuantity()-1
                             )) ?>"></a>
                  </td>
                  <td>
                  <?php if($basket_item->getProduct()->hasDiscount()): ?>
                  - <?php echo $basket_item->getProduct()->getDiscountPercent() ?>% <br />
                  <?php endif ?>
                  <?php echo $basket_item->getProduct()->getDiscountSaving() ?> kn</td>
                  <td><?php echo format_currency($basket_item->getAmount()) ?> kn</td>
                  <td class="item-last-cell">
                      <input type="button" value="ukloni iz košarice" title="ukloni iz košarice" class="remove" onClick="document.location='<?php echo url_for('basket_item_remove', array('item_id' => $basket_item->getId())) ?>';" />
                  </td>
                </tr>

<?php endforeach; ?>

                <!-- product listing end -->
              </table>
<?php endforeach ?>

              <!-- summary listing begin -->
            <table width="362" border="0" cellpadding="0" cellspacing="0" id="summary-tbl">
              <tr>
                <th width="151">Ukupno:</th>
                <td><?php echo $calc['overall']['total_wo_discount']?> kn</td>
              </tr>
              <tr>
                <th>Popust:</th>
                <td><?php echo $calc['overall']['discount'] ?> kn</td>
              </tr>
              <tr>
                <th>Dostava:</th>
                <td><?php echo $calc['overall']['delivery'] ?> kn</td>
              </tr>
              <tr>
                <th>Ukupno za platiti:</th>
                <td><?php echo $calc['overall']['delivery_total'] ?> kn</td>
              </tr>
            </table>
            <!-- summary listing begin -->

            <div id="cart-discount">
                <p>Unesite promotivni kod za ostvarivanje dodatnog popusta<br />
                 (opcionalno):
                </p>
                <input type="text" value="" class="code" />
                <input type="button" value="Potvrdi kod" class="confirm" />
            </div>
            <div id="cart-footer">
                <input 
                    type="button"
                    value="Nastavi kupovati"
                    class="button-01"
                    onClick="document.location='<?php echo url_for('category_show', array('slug'=>$sf_user->getAttribute('last_product_category_slug'))) ?>';" />
                <input 
                    type="button"
                    value="Isprazni košaricu"
                    class="button-01"
                    onClick="document.location='<?php echo url_for('basket_remove') ?>';"/>
                <input 
                    type="button"
                    value="Narudžba"
                    class="button-01"
                    onClick="document.location='<?php echo url_for('checkout_process') ?>';" />
            </div>
		  </div>

            <div class="bottom"></div>
        </div>
   </div>






